package com.ktjy.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ktjy.dto.DictDataDTO;
import com.ktjy.dto.UserDTO;
import com.ktjy.mapper.DictDataMapper;
import com.ktjy.pojo.DictData;
import com.ktjy.pojo.SysUser;
import com.ktjy.service.IDictDataService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 字典数据表 服务实现类
 * </p>
 *
 * @author author
 * @since 2025-08-20
 */
@Service
public class DictDataServiceImpl extends ServiceImpl<DictDataMapper, DictData> implements IDictDataService {
    /**
     * 获取字典数据
     * @param dictDataDTO
     * @return
     */
    @Autowired
    private DictDataMapper dictDataMapper;

    @Override
    public IPage<DictData> findPage(DictDataDTO dictDataDTO, Integer pageNo, Integer pageSize) {
        //构造分页条件
        Page page=new Page(pageNo,pageSize);
        return dictDataMapper.selectPage(page,dictDataDTO);
    }

    @Override
    public List<DictData> getDictData(DictDataDTO dictDataDTO) {
        return dictDataMapper.findDictData(dictDataDTO);
    }
}
